define(function(require) {

    // 其他模块引用的对象将作为属性统一放到_module中
    var _module = {
        aop: require('./aop')
    };

    var paramsValidator = {

        validate: function() {
            _module.aop.before('manualTimeTable', ['render'], function(jxbInfo) {
                validateJxbInfo(jxbInfo);
            });

            _module.aop.before('manualTimeTable', ['renderArranges'], function(arranges) {
                valiateArrangesInfo(arranges);
            });
        }

    };

    /**
     * 验证参数(教学班信息)信息是否完整
     * @param  {[type]} jxbInfo [description]
     * @return {[type]}         [description]
     */
    function validateJxbInfo(jxbInfo) {
        if (typeof jxbInfo === 'undefined') {
            console.warn('paramsValidator - validateJxbInfo: 传入的对象jxbInfo为空！');
            return;
        }

        var properties = [{ property: 'wid', title: 'wid' }, { property: 'jxbid', title: '教学班id' }, { property: 'jxbmc', title: '课程显示名称' }, { property: 'period', title: '授课学时' }, { property: 'unitMode', title: '节次模式' }];
        for (var i = 0; i < properties.length; i++) {
            var prop = properties[i];
            if (typeof jxbInfo[prop.property] === 'undefined') {
                console.warn('paramsValidator - validateJxbInfo: 传入的对象jxbInfo中，属性' + prop.property + '(' + prop.title + ')为空！');
            }
        }
    }

    /**
     * 验证参数（排课结果）信息是否完整
     * @param  {[type]} arranges [description]
     * @return {[type]}          [description]
     */
    function valiateArrangesInfo(arranges) {
        if (typeof arranges === 'undefined') {
            console.warn('paramsValidator - valiateArrangesInfo: 传入的对象arranges为空！');
            return;
        }
        if (arranges.length === 0) {
            return;
        }

        var properties = [{ property: 'jxbid', title: '教学班id' }, { property: 'jxbmc', title: '课程显示名称' }, { property: 'weekNum', title: '周次编号' }, { property: 'weekName', title: '周次名称' }, { property: 'week', title: '星期' }, { property: 'beginUnit', title: '开始节次' }, { property: 'endUnit', title: '结束节次' }];
        for (var i = 0; i < properties.length; i++) {
            var prop = properties[i];
            var arrange = arranges[0];
            if (typeof arrange[prop.property] === 'undefined') {
                console.warn('paramsValidator - validateJxbInfo: 传入的对象arrange中，属性' + prop.property + '(' + prop.title + ')为空！');
            }
        }

    }

    return paramsValidator;

});
